/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author amega
 */
@Entity
@Table(name = "roomService")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RoomService.findAll", query = "SELECT r FROM RoomService r"),
    @NamedQuery(name = "RoomService.findById", query = "SELECT r FROM RoomService r WHERE r.id = :id")})
public class RoomService implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Lob
    @Size(max = 65535)
    @Column(name = "info")
    private String info;
    @Basic(optional = false)
    @NotNull
    @Lob
    @Size(min = 1, max = 65535)
    @Column(name = "typeService")
    private String typeService;
    @ManyToMany(mappedBy = "roomServiceList")
    private List<Hotelroom> hotelroomList;

    public RoomService() {
    }

    public RoomService(Integer id) {
        this.id = id;
    }

    public RoomService(Integer id, String typeService) {
        this.id = id;
        this.typeService = typeService;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public String getTypeService() {
        return typeService;
    }

    public void setTypeService(String typeService) {
        this.typeService = typeService;
    }

    @XmlTransient
    public List<Hotelroom> getHotelroomList() {
        return hotelroomList;
    }

    public void setHotelroomList(List<Hotelroom> hotelroomList) {
        this.hotelroomList = hotelroomList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RoomService)) {
            return false;
        }
        RoomService other = (RoomService) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "domain.RoomService[ id=" + id + " ]";
    }
    
}
